/*
* 1videoConference -- An open source video conferencing platform.
*
* Copyright (C) 2007 - 2008, Adiance Technologies Pvt. Ltd.
*
* Hardik Sanghvi <hardik.sanghvi @adiance.com>
*
* See http://www.1videoconference.org for more information about
* the 1videoConference project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, forums and mailing lists
* for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Reflection;
using System.Collections;
using System.IO;
using System.ServiceModel;
using System.Data;
using System.ServiceModel.PeerResolvers;
using System.Diagnostics;
using NetPeerService;

namespace _videoConference.BAL
{
    [ServiceContract(CallbackContract = typeof(IsvcLoginInfo))]
    public interface IsvcLoginInfo
    {
        [OperationContract(IsOneWay = true)]
        void svcJoin(string UName);

        [OperationContract(IsOneWay = true)]
        void svcSetMID(string mid);

        [OperationContract(IsOneWay = true)]
        void svcGetDatabaseIP(string UName, string mid);

        [OperationContract(IsOneWay = true)]
        void svcSetDatabaseIP(string[] DatabaseIP, string UName, string mid);

        [OperationContract(IsOneWay = true)]
        void svcUnSetMID(string mid);

        [OperationContract(IsOneWay = true)]
        void svcSetVar();

        [OperationContract(IsOneWay = true)]
        void svcUnJoin(string UName);
    }

    public interface IsvcLoginInfoChannel : IsvcLoginInfo, IClientChannel
    {
    }

    public class CsvcLoginInfo : IsvcLoginInfo
    {
        public delegate void DelsvcJoin(string UName);
        public delegate void DelsvcSetMID(string mid);
        public delegate void DelsvcGetDatabaseIP(string UName, string mid);
        public delegate void DelsvcSetDatabaseIP(string[] DatabaseIP, string UName, string mid);
        public delegate void DelsvcUnSetMID(string mid);
        public delegate void DelsvcSetVar();
        public delegate void DelsvcUnJoin(string UName);

        public event DelsvcJoin EntsvcJoin;
        public event DelsvcSetMID EntsvcSetMID;
        public event DelsvcGetDatabaseIP EntsvcGetDatabaseIP;
        public event DelsvcSetDatabaseIP EntsvcSetDatabaseIP;
        public event DelsvcUnSetMID EntsvcUnSetMID;
        public event DelsvcSetVar EntsvcSetVar;
        public event DelsvcUnJoin EntsvcUnJoin;

        public void svcJoin(string UName)
        {
            EntsvcJoin(UName);
        }

        public void svcSetMID(string mid)
        {
            EntsvcSetMID(mid);
        }

        public void svcGetDatabaseIP(string UName, string mid)
        {
            EntsvcGetDatabaseIP(UName, mid);
        }

        public void svcSetDatabaseIP(string[] DatabaseIP, string UName, string mid)
        {
            EntsvcSetDatabaseIP(DatabaseIP, UName, mid);
        }

        public void svcUnSetMID(string mid)
        {
            EntsvcUnSetMID(mid);
        }

        public void svcSetVar()
        {
            EntsvcSetVar();
        }

        public void svcUnJoin(string UName)
        {
            EntsvcUnJoin(UName);
        }
    }
}
